<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<s:head theme="ajax" debug="true"/>
</head>
<body>
<center>
	 <s:form id="abfrm" action="insert_ok" namespace="/addrbook" method="post">
	<table border="0" width="600">	 	
		<caption><b>주소록 등록</b></caption>
		<tr>
			<td width="20%" align="right" bgcolor="ededed">
			<font color="red">*</font>분류
			</td>
			<td width="30%" align="left">
				<select name=cno>
					<s:iterator value="calist">
					<option value="${cno }">${cname }</option>
					</s:iterator>
				</select>
			</td>			
			<td width="50%">&nbsp;</td>
		</tr>
		<tr>
			<td width="20%" align="right" bgcolor="ededed">
			<font color="red">*</font>이름
			</td>
			<td width="30%" align="left">				
				<input type="text" name="name" size="20">				
			</td>			
			<td width="50%">&nbsp;</td>
		</tr>						
		<tr>
			<td width="20%" align="right" bgcolor="ededed">직급</td>
			<td width="30%" align="left">
				<input type="text" name="job" size="20">
			</td>			
			<td width="50%">&nbsp;</td>
		</tr>
		<tr>
			<td width="20%" align="right" bgcolor="ededed">회사명</td>
			<td width="30%" align="left">
				<input type="text" name="company" size="20">
			</td>			
			<td width="50%">&nbsp;</td>
		</tr>						
		<tr>
			<td width="20%" align="right" bgcolor="ededed">부서</td>
			<td width="30%" align="left">
				<input type="text" name="dept" size="20">
			</td>			
			<td width="50%">&nbsp;</td>
		</tr>
		<tr>
			<td width="20%" align="right" bgcolor="ededed">이메일</td>
			<td width="30%" align="left">
				<input type="text" name="email" size="20">
			</td>			
			<td width="50%">&nbsp;</td>
		</tr>
		<tr>
			<td width="20%" align="right" bgcolor="ededed">
			<font color="red">*</font>전화번호
			</td>
			<td width="30%" align="left">
				<input type="text" name="tel" size="20">
			</td>			
			<td width="50%">&nbsp;</td>
		</tr>
		<tr>
			<td width="20%" align="right" bgcolor="ededed">휴대전화</td>
			<td width="30%" align="left">
				<input type="text" name="hp" size="20">
			</td>			
			<td width="50%">&nbsp;</td>
		</tr>
		<tr>
			<td width="20%" align="right" bgcolor="ededed">팩스</td>
			<td width="30%" align="left">
				<input type="text" name="fax" size="20">
			</td>			
			<td width="50%">&nbsp;</td>
		</tr>
		<tr>
			<td width="20%" align="right" bgcolor="ededed">메신저ID</td>
			<td width="30%" align="left">
				<input type="text" name="msgid" size="20">
			</td>			
			<td width="50%">&nbsp;</td>
		</tr>												
		<tr>
			<td width="20%" align="right" bgcolor="ededed">주소</td>
			<td width="30%" align="left">
				<textarea rows="2" cols="20" id="addr" name="addr">
				</textarea>
				<%--
				<input type="text" id="addr" name="addr" size="20"> --%>
			</td>			
			<td width="50%" align="left">
				<input type="button" value="우편번호 검색" onclick="javascript:openZipcode()">				
			</td>
		</tr>		
		<tr>
			<td width="20%" align="right" bgcolor="ededed">생년월일</td>
			<td width="30%" align="left">
				<select name="byear">
					<c:forEach begin="1900" end="2011" step="1" var="i">
					<option value=${i }>${i }</option>
					</c:forEach>
				</select>
				<select name="bmonth">
					<c:forEach begin="1" end="12" step="1" var="i">
					<option value=${i }>${i }</option>
					</c:forEach>				
				</select>
				<select name="bday">
					<c:forEach begin="1" end="31" step="1" var="i">
					<option value=${i }>${i }</option>
					</c:forEach>
				</select>
			</td>			
			<td width="50%">&nbsp;</td>
		</tr>		
		<tr>
			<td width="20%" align="right" bgcolor="ededed">홈페이지</td>
			<td width="30%" align="left">
				<input type="text" name="homepage" size="20">
			</td>			
			<td width="50%">&nbsp;</td>
		</tr>		
		<tr>
			<td width="20%" align="right" bgcolor="ededed">비고</td>
			<td width="30%" align="left">
				<input type="text" name="description" size="20">
			</td>			
			<td width="50%">&nbsp;</td>
		</tr>
		<tr>
			<td colspan="3" align="center">
				<input type="hidden" name="msabun" value="${session.user.sabun }">
				<input type="hidden" name="type" value="${type }">				
			</td>			
		</tr>
		<%--주소록 목록으로 복귀하기위한 URL정보 type(개인,부서), 현재 페이지, 사번 --%>		
		<s:url id="listURL" action="list" namespace="/addrbook">
			<s:param name="type">${type }</s:param>
			<s:param name="curpage">${curpage }</s:param>
			<s:param name="sabun">${session.user.sabun }</s:param>		
		</s:url>		
		<tr>
			<td colspan="3">				
			</td>
		</tr>
	</table>	 	
	<s:a formId="abfrm" theme="ajax" targets="abcontents" showLoadingText="false">
		<img src="/ssteam/image/addrbook/ab_button_insert.png" border="0">
	</s:a>					
	&nbsp;
	<s:a href="%{listURL}" targets="abcontents" theme="ajax" >
		<img src="/ssteam/image/addrbook/as_update_cancel.png" border="0">
	</s:a>			
	</s:form>
</center>
</body>

</html>